package Test.FOURTH.four;


import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FIleUploadGUI {
    public static void main(String[] args) {
        Frame frame=new Frame("文件上传");
        AcitonProcesser acitonProcesser=new AcitonProcesser();
        Panel panel=new Panel();


        frame.setSize(200,200);
        frame.setLayout(new FlowLayout());

        Button button=new Button("启动服务器");
        Button button1=new Button("启动客户端，开始上传");

        button.addActionListener(acitonProcesser);
        button1.addActionListener(acitonProcesser);
        panel.add(button);
        frame.add(panel);
        frame.add(button1);

        frame.validate();
        frame.setVisible(true);

    }
}

class AcitonProcesser implements ActionListener{

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals("启动服务器")) {
            FileUploadServer fileUploadServer = new FileUploadServer();
        }else {
            FileUploadClient fileUploadClient=new FileUploadClient();
        }

    }
}
